# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudSupport.V2.Model.Attachment do
  @moduledoc """
  An Attachment contains metadata about a file that was uploaded to a case - it is NOT a file itself. That being said, the name of an Attachment object can be used to download its accompanying file through the `media.download` endpoint. While attachments can be uploaded in the console at the same time as a comment, they're associated on a "case" level, not a "comment" level.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The time at which the attachment was created.
  *   `creator` (*type:* `GoogleApi.CloudSupport.V2.Model.Actor.t`, *default:* `nil`) - Output only. The user who uploaded the attachment. Note, the name and email will be obfuscated if the attachment was uploaded by Google support.
  *   `filename` (*type:* `String.t`, *default:* `nil`) - The filename of the attachment (e.g. `"graph.jpg"`).
  *   `mimeType` (*type:* `String.t`, *default:* `nil`) - Output only. The MIME type of the attachment (e.g. text/plain).
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. The resource name of the attachment.
  *   `sizeBytes` (*type:* `String.t`, *default:* `nil`) - Output only. The size of the attachment in bytes.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :creator => GoogleApi.CloudSupport.V2.Model.Actor.t() | nil,
          :filename => String.t() | nil,
          :mimeType => String.t() | nil,
          :name => String.t() | nil,
          :sizeBytes => String.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:creator, as: GoogleApi.CloudSupport.V2.Model.Actor)
  field(:filename)
  field(:mimeType)
  field(:name)
  field(:sizeBytes)
end

defimpl Poison.Decoder, for: GoogleApi.CloudSupport.V2.Model.Attachment do
  def decode(value, options) do
    GoogleApi.CloudSupport.V2.Model.Attachment.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudSupport.V2.Model.Attachment do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
